import {
  AutoIncrement,
  Column,
  DataType,
  HasMany,
  HasOne,
  Model,
  PrimaryKey,
  Table,
} from 'sequelize-typescript';
import { Content } from './content.model';
import { Customization } from './customization.model';

@Table({
  tableName: 'resume_list',
})
export class Resume extends Model {
  @PrimaryKey
  @AutoIncrement
  @Column({
    type: DataType.INTEGER,
    allowNull: false,
    comment: '',
  })
  id: number;

  //用户id
  @Column({
    type: DataType.INTEGER,
    comment: 'userId',
  })
  userId: number;

  @Column({
    type: DataType.STRING,
    comment: '模板id',
  })
  templateId: string;

  @Column({
    type: DataType.INTEGER,
    comment: '老简历id',
  })
  oldresumeId: number;

  @Column({
    type: DataType.STRING(255),
    comment: '名字',
  })
  name: string;

  @Column({
    type: DataType.JSON,
    comment: '年龄',
  })
  birthDay: JSON;

  @Column({
    type: DataType.BOOLEAN,
    defaultValue: false,
    comment: '显示年龄',
  })
  showAge: boolean;

  // @Column({
  //   type: DataType.STRING(255),
  //   comment: '头像',
  // })
  // photo: string;

  // @Column({
  //   type: DataType.BOOLEAN,
  //   comment: '是否展示头像',
  //   defaultValue: true,
  // })
  // showPhoto: boolean;

  @Column({
    type: DataType.JSON,
  })
  photoObj: JSON;

  @Column({
    type: DataType.INTEGER,
    comment: '性别',
  })
  gender: number;

  @Column({
    type: DataType.STRING(255),
    comment: '邮箱',
  })
  email: string;

  @Column({
    type: DataType.STRING(255),
    comment: '电话',
  })
  phoneNumber: string;

  @Column({
    type: DataType.STRING(255),
    comment: '',
  })
  resumeThumbnail: string;

  @Column({
    type: DataType.STRING(255),
    comment: '意向岗位',
  })
  expJob: string;

  @Column({
    type: DataType.STRING(255),
    comment: '意向城市',
  })
  expCity: string;

  @Column({
    type: DataType.STRING(255),
    comment: '期望薪资',
  })
  expectedSalary: string;

  @Column({
    type: DataType.STRING(20),
    comment: '入职时间',
  })
  arrivalTime: string;

  @Column({
    type: DataType.STRING(200),
    comment: '籍贯',
  })
  nativePlace: string;

  @Column({
    type: DataType.STRING(20),
    comment: '民族',
  })
  nationality: string;

  @Column({
    type: DataType.STRING(50),
    comment: '现居住城市',
  })
  address: string;

  @Column({
    type: DataType.STRING(10),
    comment: '婚姻状况',
  })
  maritalStatus: string;

  @Column({
    type: DataType.STRING(10),
    comment: '政治面貌',
  })
  politicsStatus: string;

  @Column({
    type: DataType.STRING(20),
    comment: '工作年限',
  })
  workingYears: string;

  @Column({
    type: DataType.JSON,
    comment: '身高体重',
  })
  weightHeight: JSON;

  @Column({
    type: DataType.INTEGER,
    comment: '语言',
  })
  language: number;

  @Column({
    type: DataType.INTEGER,
    comment: '是否删除',
  })
  deleted: number;

  @HasMany(() => Content)
  contents: Content[];

  @HasOne(() => Customization)
  customization: Customization;

  @Column({
    type: DataType.JSON,
    comment: '字段排序',
    defaultValue: [],
  })
  detailsOrder: JSON;
}
